//
//  jsonHelper.m
//  LanQiuQuan
//
//  Created by TonyGenius on 16/3/23.
//  Copyright © 2016年 Rip. All rights reserved.
//

#import "jsonHelper.h"
#import "PlayGroundModel.h"
#import "TeamModel.h"

@implementation jsonHelper

//playGround
+ (id)jsonForPlayGroundWithDictionary:(NSDictionary *)dictionary
{
    
//    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSArray *listArray = dictionary[@"data"];
    NSMutableArray *playgroundArray = [NSMutableArray array];
    for (int i = 0; i < listArray.count; i ++) {
        PlayGroundModel *model = [[PlayGroundModel alloc] initWithDataArray:listArray[i]];
        [playgroundArray addObject:model];
    }
    return playgroundArray;
    
}

//cityTeam

+ (id)jsonForCityTeamWithDictionary:(NSDictionary *)dictionary
{
    NSArray *listArray = dictionary[@"data"];
    NSMutableArray *teamList = [NSMutableArray array];
    for (int i = 0; i < listArray.count; i ++) {
        TeamModel *teamModel = [[TeamModel alloc] initWithDictionary:listArray[i]];
        [teamList addObject:teamModel];
    }
    return teamList;
}

@end
